#include "yocto/utest/run.hpp"

#include "core/full-dyn.hpp"
#include "core/ljc.hpp"

#include "core/fcc.hpp"

#include "yocto/wtime.hpp"
#include "yocto/ios/ocstream.hpp"

using namespace FastMD;

YOCTO_UNIT_TEST_IMPL(pot)
{
	
	const Real epsilon = 1;
	const Real sigma   = 1;
	LJ         lj(epsilon,sigma);
	LJCutOff   ljc(epsilon,sigma,2.5*sigma);
	const V3D  box(12,12,12);
	const bool isothermal = false;
	
	ios::ocstream fp( "pot.dat", false );
	for( size_t m=1; m <= 10; ++m )
	{
		const U3D    cr(m,m,m);
		const size_t np = cr.items() << 2;
		Frame        frame( 3, np );
		
		
		frame.set_box(box);
		FCC::Build( frame[ Frame::POSITIONS ], cr, frame.box, frame.ibox, 0 );
		FullDynamics dyn;
		
		const Real d = np / frame.box.volume();
		fp("%g",d); std::cerr << "d=" << d;
		dyn.eval( frame, lj, isothermal);
		fp(" %g", frame.V/np); std::cerr << " V=" << frame.V/np;
		dyn.eval( frame, ljc, isothermal);
		fp(" %g", frame.V/np); std::cerr << " Vc=" << frame.V/np;
		fp("\n"); std::cerr << std::endl;
	}
	
	
	

}
YOCTO_UNIT_TEST_DONE()

